package com.xuecheng.search.service;

import com.xuecheng.commons.model.dto.CoursePubIndexDto;
import com.xuecheng.commons.model.dto.PageRequest;
import com.xuecheng.commons.model.vo.ResponseResult;
import com.xuecheng.search.domain.CoursePubIndex;

import java.io.IOException;

public interface SearchService {
    /**
     * 同步索引库
     * @param coursePubId
     */
    void saveDocument(Long coursePubId) throws IOException;

    /**
     * 根据条件查询课程发布
     * @param pageRequest
     * @param coursePubIndexDto
     * @return
     */
    ResponseResult searchCourse(PageRequest pageRequest, CoursePubIndexDto coursePubIndexDto);

    /**
     * 课程下架后删除对应的索引
     * @param courseUnpunId
     */
    void deleteDocument(Long courseUnpunId) throws IOException;

    /**
     * 根据id查询课程
     * @param id
     * @return
     */
    ResponseResult findById(String id) throws IOException;
}
